<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_AdvancedReviews
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>
<script type="text/javascript">
//<![CDATA[
    //This is parser for Advanced Reviews ver 1.1
    //Will be deprecated in future versions
    var url = '<?php echo $this->getReviewUrl() ?>';
    $$('li.helpdesk-message small').each(function(el){
        var text = el.innerHTML;
        var review_text = text.match(/Review Id: #\d+/g);
        review_text = review_text[0];
        var review_id = review_text.match(/\d+/g);
        review_id = review_id[0];        
        var new_url = url.replace('{{review_id}}', review_id);
        el.innerHTML = text.replace(review_text, '<a href="' + new_url +'">' + new_url + '</a>');
    });
//]]>
</script>

